#include <assert.h>
#include <ctype.h>
#include <locale.h>
#include <errno.h>
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <pthread.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdnoreturn.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include<windows.h>


void basic_random_number_generation(void)
{
    printf("***** basic_random_number_generation *****\n");
    int i;
    // srand(int) is used to seed the pseudo-random number generator.
    //  Each time rand() is seeded wih the same seed,
    // it must produce the same sequence of values
    printf("ctime(NULL):%s\n", ctime(NULL));
    srand(time(NULL));
    i = rand();
    printf("Random value between [0, %d]: %d\n", RAND_MAX, i);
}


void restrict_generation_to_given_range()
{
    printf("***** restrict_generation_to_given_range *****\n");
    #define uniform() ( rand() / (RAND_MAX + 1.0) )
}

void main(void)
{
    basic_random_number_generation();

    // set  random_value to a uniform random number within the range 0 to N - 1.
    int random_value = (int)(uniform() * 100);
    printf("random_value: %d\n", random_value);
    system("pause");
}